#ifndef GameManager_H
#define GameManager_H


#include <OIS.h>
#include "dkglFrameListener.h"

class GameState;

class GameManager :
	public OIS::KeyListener,
	public OIS::MouseListener,
	public DKGL::FrameListener
{
public:
	GameManager();
	~GameManager();
	
	void start(GameState* state);
	void changeState(GameState* state);
	void pushState(GameState* state);
	void popState();

	static GameManager& instance()
	{
		static GameManager _instance;
		return _instance;
	};

private:

	void frameStarted(float dt);
	void frameEnded(float dt);

	bool keyPressed(const OIS::KeyEvent &e );
	bool keyReleased( const OIS::KeyEvent &e );

	bool mouseMoved( const OIS::MouseEvent &e );
	bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
	bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );
	
	std::vector<GameState*> mStates;
};



#endif
